package models

import (
	"github.com/astaxie/beego"
	"github.com/astaxie/beego/orm"
	_ "github.com/go-sql-driver/mysql"
)

func init() {
	dataSource := beego.AppConfig.String("database::datasource")
	orm.RegisterDataBase("default", "mysql", dataSource)
	orm.RegisterModel(
		new(UserAdmin),
		new(UserAdminRole),
		new(Authority),
		new(AuthorityCategory),
		new(UserAdminRoleAuthority),
		new(Region),
		new(School),
		new(SetMeal),
		new(User),
		new(PushTime),
		new(Order),
		new(OrderSchool),
		new(OrderPushTime),
		new(WechatMenu),
		new(WechatReply),
		new(VerifyCode),
		new(SiteConfig),
	)
	orm.RunSyncdb("default", false, true)
}
